package org.suyafei.manager.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.suyafei.manager.AccountManager;
import org.suyafei.mapper.AccountMapper;
import org.suyafei.model.AccountDO;

import java.util.List;

/**
 * @author 宿某人
 * @Date: 2021/12/06/4:41 下午
 * @Description:
 */
@Slf4j
@Component
public class AccountManagerImpl implements AccountManager {

    @Autowired
    private AccountMapper accountMapper;


    @Override
    public int insert(AccountDO accountDO) {
        return accountMapper.insert(accountDO);

    }

    @Override
    public List<AccountDO> findByPhone(String phone) {
        List<AccountDO> accountDOList
                = accountMapper.selectList(new QueryWrapper<AccountDO>().eq("phone", phone).);
        return accountDOList;
    }
}
